package net.studou.verify;

public class CheckNull implements CheckChain {

	private CheckChain nextChain;
	
	private String message;

	public CheckNull(CheckChain nextChain, String message) {
		this.nextChain = nextChain;
		this.message = message;
	}

	public String check(String content) {
		if (content == null || content.trim().equals("")) {
			return message;
		} else {
			if (nextChain != null) {
				return nextChain.check(content);
			} else {
				return null;
			}
		}
	}

}
